//
//  QSViewController.m
//  QSWKWebview
//
//  Created by git-hushuai on 08/19/2020.
//  Copyright (c) 2020 git-hushuai. All rights reserved.
//

#import "QSViewController.h"
#import <SLWkWebViewIndex.h>

@interface QSViewController ()

@end

@implementation QSViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.title = @"QSWKWebView";
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)clickAction:(id)sender {
    
    SLBaseWebViewController *vc = [[SLBaseWebViewController alloc]init];
    vc.startPage = @"https://www.baidu.com";
    vc.webView.webViewScriptHandlerBlock = ^(QSBaseWebView * _Nonnull wkWebView, WKScriptMessage * _Nonnull scriptMessage) {
        NSLog(@"QSBaseWebView :%@===%@===%@",wkWebView,scriptMessage.name,scriptMessage.body);
    };
    
    [self.navigationController pushViewController:vc animated:YES];
}

@end
